<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<table class="t_css table01" width="100%" border="0" cellpadding="0"  cellspacing="1" id="fzr_msg">
	<col style="width:10%"/>
	<col style="width:23%"/>
	<col style="width:10%"/>
	<col style="width:23%"/>
	<col style="width:10%"/>
	<col style="width:24%"/>
	<tr>
		<td colspan="6" class="t_bar2"><span class="color_red">*</span>项目负责人</td>
	</tr>
	<tr>
		<td  align="right" >姓名：</td>
		<td  colspan="">
			<span name="proposal/fzr_psnname" ><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/zh_name" /></span>
			
		</td>
		<td  align="right" >性别：</td>
		<td  colspan="">
			<c:set var="gender_value"><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/gender_value" /></c:set>
			<c:choose>
				<c:when test="${gender_value=='M' }">
					<c:set var="gender_name" value="男"></c:set>
				</c:when>
				<c:otherwise>
					<c:set var="gender_name" value="女"></c:set>
				</c:otherwise>	
			</c:choose>
			<span name="proposal/gender_name" >${gender_name }</span>
			<input type="hidden" name="proposal/gender_value" value="${gender_value}" />
		</td>
		<td  align="right" >出生年月：</td>
		<td  colspan="">
			<span name="proposal/fzr_birthday" ><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/birthday" /></span>
		</td>
	</tr>
	
	<tr class="">
		<td   align="right" >学历：</td>
		<td >
            <span name="proposal/fzr_degree_name" ><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/educate_name" /></span>
		</td>
		<td  align="right" nowrap>职务：</td>
		<td >
	         <span name="proposal/position" ><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/position" /></span>
		</td>
		<td  align="right" nowrap>职称：</td>
		<td >
	         <span name="proposal/fzr_prof_title_name" ><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/prof_title_name" /></span>
		</td>
	</tr>
	<tr class="">
		<td align="right">从事专业：</td>
		<td colspan="3">
			<span name="proposal/fzr_major"  ><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/major" /></span>
		</td>
		<td align="right"><span class="color_red">*</span>手机：</td>
		<td>
			<c:set var="mobile"><x:out select="$xmlData/data/proposal/mobile" /></c:set>
		    <c:if test="${empty mobile }"><c:set var="mobile"><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/mobile" /></c:set></c:if>
			<input name="proposal/mobile" label="项目负责人-->手机" type="text"  class="input_css required mobile" onfocus="InitInput.setNumber(this,11,0,0);"   value="${mobile }"/> 
			<input type="hidden" name="zh_persons/zh_person[0]/contact/mobile" value="${mobile }"/>
		</td>
	</tr>
	<tr>
		<td colspan="6">
			<textarea id="summer_fzr" name="proposal/summer_fzr" style="width:98%" class="input_textarea required maxlength:300" label="项目负责人简介"  rows=15 cols=15 placeholder="项目负责人简介，重点填写研发经历、主要成果、技术书评和管理能力等（限300字）" ><x:out select="$xmlData/data/proposal/summer_fzr" /></textarea>
			<input type="hidden" name="proposal/summer_fzr_hidden" id="project/summer_fzr_hidden"  value="<x:out select="$xmlData/data/proposal/summer_fzr_hidden" />"/>
		</td>
	</tr>
</table>
<br/>

<div class="t_bar">
	 <span class="color_red">*</span> 项目参与成员（限30条）
</div>

	 
	
	<table  id="persons" border="0" cellspacing="0" cellpadding="0" class="table01 t_css"   width="100%"
		style="table-layout:fixed;word-break:normal;">
				<col width="3"/>
				<col width="3"/>
				<col width="7"/>
				<col width="7"/>
				<col width="3"/>
				<col width="22"/>
				<col width="7"/>
				<col width="7"/>
				<col width="23"/>
				<col width="23"/>
		<thead>
			<tr>
                <th>选择</th>
                <th>序号</th>
				<th>姓名</th>
				<th>出生年月</th>
				<th>性别</th>
				<th>从事专业</th>
				<th>职称</th>
				<th>学历</th>
				<th>所在单位</th>
				<th>项目分工</th>
			</tr>
		</thead>
		<tbody id="tab">
			<tr style="display: none">
				<td  align="center" >
					<input type="radio" name="sel_persons" onclick="setSubmitPsn()" /> 
					<input type="hidden" name="persons|zh_person[0]|basic_info|ethnicity_value" /> 
					<input type="hidden" name="persons|zh_person[0]|basic_info|ethnicity_name" /> 
					<input type="hidden" name="persons|zh_person[0]|basic_info|subject_code" /> 
					<input type="hidden" name="persons|zh_person[0]|basic_info|subject_name" /> 
					<input type="hidden" name="persons|zh_person[0]|basic_info|discipline_code" /> 
					<input type="hidden" name="persons|zh_person[0]|basic_info|discipline_name" /> 
					<input type="hidden" name="persons|zh_person[0]|basic_info|region_value" /> 
					<input type="hidden" name="persons|zh_person[0]|basic_info|region_name" /> 
					<input type="hidden" name="persons|zh_person[0]|basic_info|card_type_value" />
					<input type="hidden" name="persons|zh_person[0]|basic_info|academician_value" /> 
					<input type="hidden" name="persons|zh_person[0]|basic_info|academician_name" /> 
					<input type="hidden" name="persons|zh_person[0]|basic_info|org_code" /> 
					<input type="hidden" name="persons|zh_person[0]|contact|tel_work" /> 
					<input type="hidden" name="persons|zh_person[0]|contact|fax" /> 
					<input type="hidden" name="persons|zh_person[0]|basic_info|post_code" />
					<input type="hidden" name="persons|zh_person[0]|basic_info|position" /> 
					<input type="hidden" name="persons|zh_person[0]|basic_info|degree_value" /> 
					<input type="hidden" name="persons|zh_person[0]|basic_info|degree_name" /> 
					<input type="hidden" name="persons|zh_person[0]|basic_info|degree_country_value" /> 
					<input type="hidden" name="persons|zh_person[0]|basic_info|degree_country_name" /> 
					<input type="hidden" name="persons|zh_person[0]|basic_info|degree_college" /> 
					<input type="hidden" name="persons|zh_person[0]|basic_info|degree_year" /> 
					<input type="hidden" name="persons|zh_person[0]|basic_info|address" />
					<input type="hidden" name="persons|zh_person[0]|basic_info|prof_title" />
					<input type="hidden" name="persons|zh_person[0]|basic_info|prof_title_value" />
					<input type="hidden" name="persons|zh_person[0]|basic_info|post_doctor_value"/>
					<input type="hidden" name="persons|zh_person[0]|basic_info|post_doctor_name"/>
					<input type="hidden" name="persons|zh_person[0]|basic_info|birth_date"/>
					<input type="hidden" name="persons|zh_person[0]|basic_info|gender_value"/>
					<input type="hidden" name="persons|zh_person[0]|basic_info|age"/>
					<input type="hidden" name="persons|zh_person[0]|basic_info|educate_value"/>
					<input type="hidden" name="persons|zh_person[0]|iscomember" value="0"/>
					<input type="hidden" name="persons|zh_person[0]|researches" label="xml"/>
					<input type="hidden" name="persons|zh_person[0]|basic_info|card_type_name" />
					<input type="hidden" name="persons|zh_person[0]|basic_info|card_code"/>
					<input type="hidden" name="persons|zh_person[0]|contact|email"/>
					<input type="hidden" name="persons|zh_person[0]|contact|mobile"/>
				</td>
				<td align="center">
					<span name="persons|zh_person[0]@seq_no">[index]</span>
				</td>
				<td >
					<span name="persons|zh_person[0]|basic_info|zh_name"></span>
				</td>
				<td align="center">
					<span name="persons|zh_person[0]|basic_info|birthday"></span>
				</td>
				<td align="center">
					<span name="persons|zh_person[0]|basic_info|gender_name"></span>
				</td>
				<td align="center">
					<span name="persons|zh_person[0]|contact|major_work"></span>
				</td>
				<td align="center">
					<span name="persons|zh_person[0]|basic_info|prof_title_name"></span>
				</td>
				<td align="center">
					<span name="persons|zh_person[0]|basic_info|educate_name"></span>
				</td>
				<td align="center">
					<span  name="persons|zh_person[0]|basic_info|org_name" ></span>
				</td>
				<td align="center">
					<span name="persons|zh_person[0]|basic_info|work" ></span>
				</td>
			</tr>
			<c:set value="0" var="index" scope="page" />
			<x:forEach select="$xmlData/data/persons/zh_person" var="zh_person">
				<c:choose>
					<c:when test="${index<10}">
						<c:set value="0" var="flag" scope="page" />
					</c:when>
					<c:otherwise>
						<c:set value="" var="flag" scope="page" />
					</c:otherwise>
				</c:choose>
				<tr>
					<td  align="center"  width="50px" >
						<input type="radio" name="sel_persons" onclick="setSubmitPsn()" /> 
						
						<input type="hidden" name="persons/zh_person[${flag}${index}]/basic_info/en_name" value="<x:out select="$zh_person/basic_info/en_name" />"/>
						<input type="hidden" name="persons/zh_person[${flag}${index}]/basic_info/ethnicity_value" value="<x:out select="$zh_person/basic_info/ethnicity_value" />"/>
						<input type="hidden" name="persons/zh_person[${flag}${index}]/basic_info/ethnicity_name" value="<x:out select="$zh_person/basic_info/ethnicity_name" />"/>
						<input type="hidden" name="persons/zh_person[${flag}${index}]/basic_info/subject_code" value="<x:out select="$zh_person/basic_info/subject_code" />"/>
						<input type="hidden" name="persons/zh_person[${flag}${index}]/basic_info/subject_name" value="<x:out select="$zh_person/basic_info/subject_name" />"/>
						<input type="hidden" name="persons/zh_person[${flag}${index}]/basic_info/discipline_code" value="<x:out select="$zh_person/basic_info/discipline_code" />"/>
						<input type="hidden" name="persons/zh_person[${flag}${index}]/basic_info/discipline_name" value="<x:out select="$zh_person/basic_info/discipline_name" />"/>
						<input type="hidden" name="persons/zh_person[${flag}${index}]/basic_info/region_value" value="<x:out select="$zh_person/basic_info/region_value" />" />
						<input type="hidden" name="persons/zh_person[${flag}${index}]/basic_info/region_name" value="<x:out select="$zh_person/basic_info/region_name" />" />
						<input type="hidden" name="persons/zh_person[${flag}${index}]/basic_info/gender_value" value="<x:out select="$zh_person/basic_info/gender_value" />" />
						<input type="hidden" name="persons/zh_person[${flag}${index}]/basic_info/card_type_value" value="<x:out select="$zh_person/basic_info/card_type_value" />" />
						<input type="hidden" name="persons/zh_person[${flag}${index}]/basic_info/academician_value" value="<x:out select="$zh_person/basic_info/academician_value" />" />
						<input type="hidden" name="persons/zh_person[${flag}${index}]/basic_info/academician_name" value="<x:out select="$zh_person/basic_info/academician_name" />" />
						<input type="hidden" name="persons/zh_person[${flag}${index}]/basic_info/org_code" value="<x:out select="$zh_person/basic_info/org_code" />" />
						<input type="hidden" name="persons/zh_person[${flag}${index}]/contact/tel_work" value="<x:out select="$zh_person/contact/tel_work" />" />
						<input type="hidden" name="persons/zh_person[${flag}${index}]/contact/fax" value="<x:out select="$zh_person/contact/fax" />" />
						<input type="hidden" name="persons/zh_person[${flag}${index}]/basic_info/position" value="<x:out select="$zh_person/basic_info/position" />" />
						<input type="hidden" name="persons/zh_person[${flag}${index}]/basic_info/degree_value" value="<x:out select="$zh_person/basic_info/degree_value" />" />
						<input type="hidden" name="persons/zh_person[${flag}${index}]/basic_info/degree_name" value="<x:out select="$zh_person/basic_info/degree_name" />" />
						<input type="hidden" name="persons/zh_person[${flag}${index}]/basic_info/post_code" value="<x:out select="$zh_person/basic_info/post_code" />" />
						<input type="hidden" name="persons/zh_person[${flag}${index}]/basic_info/degree_country_value" value="<x:out select="$zh_person/basic_info/degree_country_value" />" /> 
						<input type="hidden" name="persons/zh_person[${flag}${index}]/basic_info/degree_country_name" value="<x:out select="$zh_person/basic_info/degree_country_name" />" /> 
						<input type="hidden" name="persons/zh_person[${flag}${index}]/basic_info/degree_college" value="<x:out select="$zh_person/basic_info/degree_college" />" /> 
						<input type="hidden" name="persons/zh_person[${flag}${index}]/basic_info/degree_year" value="<x:out select="$zh_person/basic_info/degree_year" />" /> 
						<input type="hidden" name="persons/zh_person[${flag}${index}]/basic_info/prof_title" value="<x:out select="$zh_person/basic_info/prof_title" />" /> 
						<input type="hidden" name="persons/zh_person[${flag}${index}]/basic_info/prof_title_value" value="<x:out select="$zh_person/basic_info/prof_title_value" />" /> 
						<input type="hidden" name="persons/zh_person[${flag}${index}]/basic_info/address" value="<x:out select="$zh_person/basic_info/address" />"/>
						<input type="hidden" name="persons/zh_person[${flag}${index}]/basic_info/post_doctor_value" value="<x:out select="$zh_person/basic_info/post_doctor_value" />"/>
						<input type="hidden" name="persons/zh_person[${flag}${index}]/basic_info/post_doctor_name" value="<x:out select="$zh_person/basic_info/post_doctor_name" />"/>
						<input type="hidden" name="persons/zh_person[${flag}${index}]/basic_info/age" value="<x:out select="$zh_person/basic_info/age" />"/>
						<input type="hidden" name="persons/zh_person[${flag}${index}]/basic_info/educate_value" value="<x:out select="$zh_person/basic_info/educate_value" />"/>
						<input type="hidden" name="persons/zh_person[${flag}${index}]/basic_info/card_code" value="<x:out select="$zh_person/basic_info/card_code" />"/>
						<input type="hidden" name="persons/zh_person[${flag}${index}]/basic_info/card_type_name" value="<x:out select="$zh_person/basic_info/card_type_name" />"/>
						<input type="hidden" name="persons/zh_person[${flag}${index}]/contact/email" value="<x:out select="$zh_person/contact/email" />"/>
						<input type="hidden" name="persons/zh_person[${flag}${index}]/contact/mobile" value="<x:out select="$zh_person/contact/mobile" />"/>
						<input type="hidden" name="persons/zh_person[${flag}${index}]/iscomember" value="0"/>
						
						<input type="hidden" name="persons/zh_person[${flag}${index}]/researches" label="xml"/>
					</td>
					<td align="center">
					<span name="persons/zh_person[${flag}${index}]@seq_no">${index+1}</span>
					</td>
					<td >
						<span name="persons/zh_person[${flag}${index}]/basic_info/zh_name"><x:out select="$zh_person/basic_info/zh_name" /></span>
						<security:authorize ifAnyGranted="A_DAILU_PROPOSAL">
						<c:if test="${index==0 }"><a href="###" class="Blue" style="text-decoration: none;" onclick="selectFirstRadio(this);editRow('persons','${ctx}/proposal/edit/dialog/psnInfoEdit_qnkjxxxm_2017?parentTab=persons&type=edit&needMeetingInfo=${param.needMeetingInfo}&psnCode=<x:out select="$zh_person/basic_info/psn_code" />&TB_iframe=true&height=440&width=900','编辑项目参与人信息')">[&nbsp;设置&nbsp;]</a></c:if>
						</security:authorize>
					</td>
					<td align="center">
						<span name="persons/zh_person[${flag}${index}]/basic_info/birthday"><x:out select="$zh_person/basic_info/birthday" /></span>
					</td>
					<td align="center">
						<span name="persons/zh_person[${flag}${index}]/basic_info/gender_name">
							<c:set var="gender_value"><x:out select="$zh_person/basic_info/gender_value" /></c:set>
							<c:set var="gender_name"><x:out select="$zh_person/basic_info/gender_name" /></c:set>
							<c:choose>
								<c:when test="${empty gender_name }">
									<c:if test="${gender_value eq 'M' }">男</c:if>
									<c:if test="${gender_value eq 'F' }">女</c:if>
								</c:when>
								<c:otherwise>${gender_name }</c:otherwise>
							</c:choose>	
						</span>
					</td>
					<td align="center">					
						<span name="persons/zh_person[${flag}${index}]/contact/major_work"><x:out select="$zh_person/contact/major_work" /></span>
					</td>
					<td align="center">
						<span name="persons/zh_person[${flag}${index}]/basic_info/prof_title_name"><x:out select="$zh_person/basic_info/prof_title_name" /></span>
					</td>
					<td align="center"> 
						<span name="persons/zh_person[${flag}${index}]/basic_info/educate_name"><x:out select="$zh_person/basic_info/educate_name" /></span>
					</td>
					<td align="center">
						<span name="persons/zh_person[${flag}${index}]/basic_info/org_name"><x:out select="$zh_person/basic_info/org_name" /></span>
					</td>
					<td align="center">
						<span name="persons/zh_person[${flag}${index}]/basic_info/work"><x:out select="$zh_person/basic_info/work" /></span>
					</td>
				</tr>
				<c:set value="${index+1}" var="index" scope="page" />
			</x:forEach>
			</tbody>
	</table>
	<table id="jbutton1" border="0" cellpadding="0" cellspacing="1">
		<tr>
			<td>
				<input class="button_02" type="button" value="添加" onclick="if(checkTabLimit('persons',30,'项目参与人员最多只能填写30条')){addNewRow('persons','${ctx}/proposal/edit/dialog/psnInfoEdit_kjjzfp_2017?parentTab=persons&type=add&needMeetingInfo=${param.needMeetingInfo}&TB_iframe=true&height=440&width=900','添加项目参与人');}try{top.resizeFrame();}catch(e){};">
				&nbsp;<input class="button_02"  id="zh_psnPrev" type="button" value="上移" onclick="movePrev('persons');setSubmitPsn()">
				&nbsp;<input class="button_02"  id="zh_psnNext" type="button" value="下移" onclick="moveNext('persons');setSubmitPsn()">
				&nbsp;<input class="button_02"  id="zh_psnEdit" type="button" value="编辑" onclick="editRow('persons','${ctx}/proposal/edit/dialog/psnInfoEdit_kjjzfp_2017?parentTab=persons&type=edit&needMeetingInfo=${param.needMeetingInfo}&TB_iframe=true&height=440&width=900','编辑项目参与人信息')">
				&nbsp;<input class="button_02"  id="zh_psnDel" type="button" value="删除" onclick="deleteSelectedRow('persons','人员信息');"></td>
		</tr>
		</tbody>
		<tfoot>
		</tfoot>
	</table>
	
<script type="text/javascript">
function selectFirstRadio(obj) {
	$(obj).parent('td').parent('tr').find('input[type="radio"]').attr("checked","checked");
	setSubmitPsn();
}
function checkSubmitPsn(tableId){
	<security:authorize ifNotGranted="A_DAILU_PROPOSAL">
	var tr=$("#"+tableId+" :radio:checked").parents("tr");
	if(tr.length!=0 && tr.get(0).rowIndex==2){
		scmWarn('如果您需要修改申请人信息， 请保存申请书后点击菜单“管理”>“个人信息维护”完成修改');
		return false;
	}
	</security:authorize>
	
	return true;
		
}
function psnSynchro(){
	$("span[name$='fzr_psnname']").text($("#persons tr:eq(2)").find("span[name$='basic_info/zh_name']").text());
	$("span[name$='fzr_tel']").text($("#persons tr:eq(2)").find("input[name$='contact/tel_work']").val());
	$("span[name$='fzr_mobile']").text($("#persons tr:eq(2)").find("input[name$='contact/mobile']").val());
	$("span[name$='fzr_mail']").text($("#persons tr:eq(2)").find("input[name$='contact/email']").val());
}

/**
 * 锁定申报人行的按钮
 */
function setSubmitPsn() {
	if($("#persons :radio:checked").length==0){
		scmWarn('请选择一行!');
		return false;
	}
	var tr = $("#zh_persons :radio:checked").parents("tr");
	if (tr.get(0).rowIndex - 1 == 1) {// 如果选择的是申报人
		$("#zh_psnPrev").attr("disabled", "true").css("color", "#808080");
		$("#zh_psnNext").attr("disabled", "true").css("color", "#808080");
		// $("#zh_psnEdit").attr("disabled","true").css("color","#808080");
		$("#zh_psnDel").attr("disabled", "true").css("color", "#808080");

	} else if (tr.get(0).rowIndex - 1 == 2) {// 如果是申报书的下一行
		$("#zh_psnPrev").attr("disabled", "true").css("color", "#808080");
		$("#zh_psnNext").removeAttr("disabled").css("color", "#003366");
		$("#zh_psnDel").removeAttr("disabled").css("color", "#003366");
	} else {
		$("#zh_psnPrev").removeAttr("disabled").css("color", "#003366");
		$("#zh_psnNext").removeAttr("disabled").css("color", "#003366");
		// $("#zh_psnEdit").removeAttr("disabled").css("color","#003366");
		$("#zh_psnDel").removeAttr("disabled").css("color", "#003366");
	}

}
</script>
	 